<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head ""> </@frame.head>

<script type="text/javascript">
	var path = "${contextPath}";
</script>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>跟着学</title>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/follow/reset.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/follow/follow.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/courses/css/reset.css">
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/courses/font/iconfont.css">
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/courses/css/classList.css">
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/font/iconfont.css" />
<script src="${contextPath}/resources/js/follow/jquery-1.8.3.js" type="text/javascript"></script>
<script src="${contextPath}/resources/js/follow/config.js" type="text/javascript"></script>
<script src="${contextPath}/resources/js/follow/follow.js" type="text/javascript"></script>
<script type="text/javascript">
		//删除
		$(function() {
			//删除显示
			var del = document.getElementsByClassName('delete')[0];
			$('.item').on('click', '.f-third', function() {
				var odata = $(this).attr('data-show');
				if (odata == '1') {
					del.style.display = 'block';
				} else {
					del.style.display = 'none';
				}
			})
			$('.delete').on('click', '.cha', function() {
				del.style.display = "none";
			})
		})
	</script>
</head>
<body text-align:center>
	<div id="wrap" style="margin:0 auto">
		<div class="content">
			<!--头部-->
			
			<form method="post" name="query_product_form" id="query_product_form"
				action="${contextPath}/ftp/followThePainting_list">
				 <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />  
 				 <input type="hidden" name="checkboxs" value="${checkboxs}"  id="checkboxs" />
 				 <input type="hidden" name="upOrDown" value="${upOrDown}"  id="upOrDown" />   
				<div class="text-c">
					<table class="table search_table">
						<tr>
							<table class="table search_table">
						<tr>
								
									<tr>
										
										<td>专业
										<select name="typeOne" id="province" onchange="show(this.options[this.options.selectedIndex].value)">
												<option value="" >请选择</option>
										<#list coursesTypeList as list>
											<option value="${list.id}">${list.coursesType}</option>
										</#list>
										
										</select>
										 <select name="typeTwo" id="pId">
												<!-- <option value="">请选择</option>-->
												
												</select> 
										</td>
									</tr>
								跟着画名称:&nbsp;&nbsp;
							<input type="text" class="input-text" style="width: 250px"
								placeholder="输入标题名称" value="${CoursesQo.ftsTitle}" id=""
								name="ftsTitle"> &nbsp;&nbsp;
							<button type="submit" class="btn btn-success radius" id=""
								name="">
								<i class="Hui-iconfont">&#xe665;</i> 搜 索
							</button>
						</tr>
					</table>
				</div>
			</form>
			<div class="nav">
				<p class="f-left">
					<i class="iconfont">&#xe69e;</i> <span>跟着学列表</span>
				</p>
				<p class="f-right">
					 <a href="javascript:function()" onclick="addfollow();" type="button" class="btn btn-primary radius"> 跟着学上传</a>
				</p>
			</div>
			<!--主体部分-->
			<div class="f-body">

				<!--列表-->
				<ul class="list">
					<#list pagination.list as list>
					<li class="item">
						<div class="f-img">
							<img src="${webPath}/followThePainting/${list.cover}" alt="" / class="study">
							<p class="text">
								<span>${list.ftsTitle}</span>
							</p>
						</div>
						<div class="f-con">
							<p class="d-left">
								<span>${list.typeOne.coursesType}/</span><span>${list.typeTwo.coursesType}</span>
							</p>
							<p class="d-right">
								<!-- <a href="javascript:;" class="f-first"> <b>修改/</b> -->
								</a> <a href="javascript:;" class="f-second"> <b>查看/</b>
								</a> <a href="javascript:;" type="button"
									onclick="delfollows(${list.id?c});" class="f-third"
									data-show="1"> <b>删除</b>
								</a>
							</p>
						</div>

					</li>
					</#list>
				</ul>
			</div>

		</div>
	</div>
	<!--底部分页-->
	<!--<div class="f-footer">
		
	</div>-->
	<@frame.end "default"> </@frame.end>
	<span style="display: none;"> </span>
	<!-- 代码部分begin -->
	 <div id="div_page" style="padding-top: 10px;float: right"></div>
</body>
<script type="text/javascript"
	src="${contextPath}/resources/js/system/followPainting.js"></script>
	<script type="text/javascript"
	src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
	cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
    skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
    last: ${pagination.totalPage},
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
        	window.location.href = path + "/ftp/followThePainting_list?page=" + obj.curr
        }
    }
})  

</script>

</script>
<script type="text/javascript">


function addfollow(){
	var url=path+"/ftp/tz_folloAdd"
	
	if(url!=""){
	      var index = layer.open({
	            type: 2,
	            title: '跟着画上传',
	            scrollbar: true,
	            maxmin: true,
	            content: url,
	            area: ['800px', '600px']
	        });
	      layer.full(index);
	    }
    }

var path="${contextPath}";
var sts;
sts="<option value>请选择</option>";
$("#pId").html(sts);
function show(type) {
	
	if (type=="") {
		var sts;
		sts="<option value>请选择</option>";
		$("#pId").html(sts);
	}else{ 
		 $.ajax({
			url : path+"/ftp/coursesType_Subctype?typeOne="+type,
			cache : false,
			type : 'post',
			dataType : 'json',
			error : function() {
				layer.alert("操作失败!");
			},
			success : function(message) {
				console.log(message)
        		if(message.code == "200"){
                    var arr=message.message;
                    var str;
                    for(var i=0;i<arr.length;i++){
                    	str=str+"<option value="+arr[i].id+" >"+arr[i].coursesType+"</option>";
                    }
                    $("#pId").html(str);
 				}else if(message == "500"){
 					layer.alert("系统繁忙！");
 				}else{
 					layer.alert(message);
 				}
			},complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
	  });
 	}
} 
function addFolloThePainting(){
	var url=path+"/ftp/tz_folloAdd"
}
</script>
</html>